<template>
  <div>
    <ul>
      <router-link to="/movie" tag="li" active-class="active">电影</router-link>
      <router-link to="/theater" tag="li" active-class="active">影院</router-link>
    </ul>
    <hr>
    <router-view></router-view>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  mounted() {
    // axios({
    //   url: '/api/list'
    // })
    // .then(result => {
    //   console.log(result)
    // })
    fetch('/api/list')
      .then(response => response.json())
      .then(result => {
        console.log(result)
      })
  },
}
</script>

<style lang="stylus" scoped>
li.active
  color red
</style>